package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;

public class _jet_deleteEntity_3 implements JET2Template {
    private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
    private static final String _jetns_java = "org.eclipse.jet.javaTags"; //$NON-NLS-1$

    public _jet_deleteEntity_3() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
    
    private static final TagInfo _td_java_format_1_1 = new TagInfo("java:format", //$NON-NLS-1$
            1, 1,
            new String[] {
            },
            new String[] {
            } );
    private static final TagInfo _td_c_get_3_20 = new TagInfo("c:get", //$NON-NLS-1$
            3, 20,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_3_71 = new TagInfo("c:get", //$NON-NLS-1$
            3, 71,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_3_122 = new TagInfo("c:get", //$NON-NLS-1$
            3, 122,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_4_3 = new TagInfo("c:get", //$NON-NLS-1$
            4, 3,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_4_64 = new TagInfo("c:get", //$NON-NLS-1$
            4, 64,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_5_3 = new TagInfo("c:get", //$NON-NLS-1$
            5, 3,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_9_20 = new TagInfo("c:get", //$NON-NLS-1$
            9, 20,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_9_91 = new TagInfo("c:get", //$NON-NLS-1$
            9, 91,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_10_19 = new TagInfo("c:get", //$NON-NLS-1$
            10, 19,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "lowercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_10_97 = new TagInfo("c:get", //$NON-NLS-1$
            10, 97,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_11_31 = new TagInfo("c:get", //$NON-NLS-1$
            11, 31,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "uppercaseFirst($eachTable/@name)", //$NON-NLS-1$
            } );

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        RuntimeTagElement _jettag_java_format_1_1 = context.getTagFactory().createRuntimeTag(_jetns_java, "format", "java:format", _td_java_format_1_1); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_java_format_1_1.setRuntimeParent(null);
        _jettag_java_format_1_1.setTagInfo(_td_java_format_1_1);
        _jettag_java_format_1_1.doStart(context, out);
        JET2Writer _jettag_java_format_1_1_saved_out = out;
        while (_jettag_java_format_1_1.okToProcessBody()) {
            out = out.newNestedContentWriter();
            out.write(NL);         
            // 针对自身表
            out.write("\tpublic void delete");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_3_20 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_3_20); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_3_20.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_3_20.setTagInfo(_td_c_get_3_20);
            _jettag_c_get_3_20.doStart(context, out);
            _jettag_c_get_3_20.doEnd();
            out.write("(");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_3_71 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_3_71); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_3_71.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_3_71.setTagInfo(_td_c_get_3_71);
            _jettag_c_get_3_71.doStart(context, out);
            _jettag_c_get_3_71.doEnd();
            out.write(" ");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_3_122 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_3_122); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_3_122.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_3_122.setTagInfo(_td_c_get_3_122);
            _jettag_c_get_3_122.doStart(context, out);
            _jettag_c_get_3_122.doEnd();
            out.write("){");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t\t");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_4_3 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_4_3); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_4_3.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_4_3.setTagInfo(_td_c_get_4_3);
            _jettag_c_get_4_3.doStart(context, out);
            _jettag_c_get_4_3.doEnd();
            out.write("DAO.remove(");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_4_64 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_4_64); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_4_64.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_4_64.setTagInfo(_td_c_get_4_64);
            _jettag_c_get_4_64.doStart(context, out);
            _jettag_c_get_4_64.doEnd();
            out.write(");");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t\t");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_5_3 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_5_3); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_5_3.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_5_3.setTagInfo(_td_c_get_5_3);
            _jettag_c_get_5_3.doStart(context, out);
            _jettag_c_get_5_3.doEnd();
            out.write("DAO.flush();");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t}");  //$NON-NLS-1$        
            out.write(NL);         
            // 根据ids批量删除
            out.write("\t@Transactional");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\tpublic void delete");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_9_20 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_9_20); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_9_20.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_9_20.setTagInfo(_td_c_get_9_20);
            _jettag_c_get_9_20.doStart(context, out);
            _jettag_c_get_9_20.doEnd();
            out.write("s(Set<Integer> delete");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_9_91 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_9_91); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_9_91.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_9_91.setTagInfo(_td_c_get_9_91);
            _jettag_c_get_9_91.doStart(context, out);
            _jettag_c_get_9_91.doEnd();
            out.write("sId) {");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t\tQuery query  =  ");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_10_19 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_10_19); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_10_19.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_10_19.setTagInfo(_td_c_get_10_19);
            _jettag_c_get_10_19.doStart(context, out);
            _jettag_c_get_10_19.doEnd();
            out.write("DAO.createNamedQuery(\"delete");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_10_97 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_10_97); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_10_97.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_10_97.setTagInfo(_td_c_get_10_97);
            _jettag_c_get_10_97.doStart(context, out);
            _jettag_c_get_10_97.doEnd();
            out.write("sById\", -1, -1);");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t\tquery.setParameter(1, delete");  //$NON-NLS-1$        
            RuntimeTagElement _jettag_c_get_11_31 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_11_31); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_get_11_31.setRuntimeParent(_jettag_java_format_1_1);
            _jettag_c_get_11_31.setTagInfo(_td_c_get_11_31);
            _jettag_c_get_11_31.doStart(context, out);
            _jettag_c_get_11_31.doEnd();
            out.write("sId);");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t\tquery.executeUpdate();");  //$NON-NLS-1$        
            out.write(NL);         
            out.write("\t}\t\t\t");  //$NON-NLS-1$        
            out.write(NL);         
            _jettag_java_format_1_1.handleBodyContent(out);
        }
        out = _jettag_java_format_1_1_saved_out;
        _jettag_java_format_1_1.doEnd();
    }
}
